import 'package:seedfour/generated/json/base/json_field.dart';
import 'package:seedfour/generated/json/user_account_alloc_entity.g.dart';
import 'dart:convert';
export 'package:seedfour/generated/json/user_account_alloc_entity.g.dart';

@JsonSerializable()
class UserAccountAllocEntity {
  late int total = 0;
  late double totalRemain = 0.00;
  late List<UserAccountAllocData> data = [];

  UserAccountAllocEntity();

  factory UserAccountAllocEntity.fromJson(Map<String, dynamic> json) =>
      $UserAccountAllocEntityFromJson(json);

  Map<String, dynamic> toJson() => $UserAccountAllocEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class UserAccountAllocData {
  late String id = '';
  late String title = '';
  late int updatedAt = 0;
  late String collectionDate = '';
  late String orderAmount = '';
  late int payAmount = 0;
  late String agentUid = '';
  late String agentUsername = '';
  late int allocStatus = 0;
  late String allocContent = '';
  late UserAccountAllocDataInvoiceObj invoiceObj;
  late int marginAmount = 0;
  dynamic marginDate;
  late String uid = '';
  late String mobile = '';
  late double availableAmount = 0.00;
  late int remainAmount = 0;
  late String updatedAtStr = '';
  late UserAccountAllocDataSettle settle;
  late bool isManOrder = false;

  UserAccountAllocData();

  factory UserAccountAllocData.fromJson(Map<String, dynamic> json) =>
      $UserAccountAllocDataFromJson(json);

  Map<String, dynamic> toJson() => $UserAccountAllocDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class UserAccountAllocDataInvoiceObj {
  late String showTab = '';
  late String email = '';
  late List<UserAccountAllocDataInvoiceObjRelateCases> relateCases = [];
  late List<dynamic> orderAttachs = [];
  late String invoiceStatusTime = '';
  late String invoiceStatusTaker = '';

  UserAccountAllocDataInvoiceObj();

  factory UserAccountAllocDataInvoiceObj.fromJson(Map<String, dynamic> json) =>
      $UserAccountAllocDataInvoiceObjFromJson(json);

  Map<String, dynamic> toJson() => $UserAccountAllocDataInvoiceObjToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class UserAccountAllocDataInvoiceObjRelateCases {
  late String caseId = '';
  late String caseName = '';
  late String time = '';

  UserAccountAllocDataInvoiceObjRelateCases();

  factory UserAccountAllocDataInvoiceObjRelateCases.fromJson(
          Map<String, dynamic> json) =>
      $UserAccountAllocDataInvoiceObjRelateCasesFromJson(json);

  Map<String, dynamic> toJson() =>
      $UserAccountAllocDataInvoiceObjRelateCasesToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class UserAccountAllocDataSettle {
  late String ratio = '';
  late String settleAmount = '';

  UserAccountAllocDataSettle();

  factory UserAccountAllocDataSettle.fromJson(Map<String, dynamic> json) =>
      $UserAccountAllocDataSettleFromJson(json);

  Map<String, dynamic> toJson() => $UserAccountAllocDataSettleToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
